package com.ssy.lingxi.member.merchant.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 权益历史记录
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-15
 */
@Entity
@Table(schema = "public", name = "ms_mc_member_right_history", indexes = {@Index(name="ms_mc_member_right_history_member_id_idx", columnList = "memberId"), @Index(name="ms_mc_member_right_history_role_id_idx", columnList = "roleId"), @Index(name="ms_mc_member_right_history_sub_member_id_idx", columnList = "subMemberId"), @Index(name="ms_mc_member_right_history_sub_role_id_idx", columnList = "subRoleId"),
        @Index(name="ms_mc_member_right_history_rel_type_idx", columnList = "relType"),
        @Index(name="ms_mc_member_right_history_business_no_idx", columnList = "businessNo")})
public class MemberRightHistoryDO implements Serializable {
    private static final long serialVersionUID = -294651367841416757L;

    /**
     * 记录id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="member_right_history_seq")
    @SequenceGenerator(sequenceName="ms_mc_member_right_history_seq", name="member_right_history_seq",allocationSize = 1)
    private Long id;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "timestamp")
    private LocalDateTime createTime;

    /**
     * 上下级关联类型
     */
    @Column(columnDefinition = "int")
    private Integer relType;

    /**
     * 上级会员Id
     */
    @Column
    private Long memberId;

    /**
     * 上级会员角色Id
     */
    @Column
    private Long roleId;

    /**
     * 下级会员Id
     */
    @Column
    private Long subMemberId;

    /**
     * 下级会员角色Id
     */
    @Column
    private Long subRoleId;

    /**
     * 会员权益类型枚举，定义在MemberRightTypeEnum中
     */
    @Column(columnDefinition = "int2")
    private Integer rightTypeEnum;

    /**
     * 权益名称
     */
    @Column(columnDefinition = "varchar(20)")
    private String rightTypeName;

    /**
     * 获取的数量（返现金额、积分）
     */
    @Column(columnDefinition = "numeric")
    private BigDecimal point;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(200)")
    private String remark;


    /**
     * 业务编号（格式：x_业务编号，x=MemberRightPointsTypeEnum.code）
     */
    @Column(columnDefinition = "varchar(30)")
    private String businessNo;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Integer getRelType() {
        return relType;
    }

    public void setRelType(Integer relType) {
        this.relType = relType;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getSubMemberId() {
        return subMemberId;
    }

    public void setSubMemberId(Long subMemberId) {
        this.subMemberId = subMemberId;
    }

    public Long getSubRoleId() {
        return subRoleId;
    }

    public void setSubRoleId(Long subRoleId) {
        this.subRoleId = subRoleId;
    }

    public Integer getRightTypeEnum() {
        return rightTypeEnum;
    }

    public void setRightTypeEnum(Integer rightTypeEnum) {
        this.rightTypeEnum = rightTypeEnum;
    }

    public String getRightTypeName() {
        return rightTypeName;
    }

    public void setRightTypeName(String rightTypeName) {
        this.rightTypeName = rightTypeName;
    }

    public BigDecimal getPoint() {
        return point;
    }

    public void setPoint(BigDecimal point) {
        this.point = point;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getBusinessNo() {
        return businessNo;
    }

    public void setBusinessNo(String businessNo) {
        this.businessNo = businessNo;
    }
}
